<?php
/**
 * Created by PhpStorm.
 * User: ai
 * Date: 2017/10/16
 * Time: 13:14
 */

use kartik\widgets\ActiveForm;
use kartik\builder\TabularForm;
use kartik\grid\GridView;
use yii\helpers\Html;

$form_contact = ActiveForm::begin();
$attribs = $contactSearchModel->getFormAttributes();
//    unset($attribs['attributes']['color']);
//    $attribs['attributes']['status'] = [
//        'type'=>TabularForm::INPUT_WIDGET,
//        'widgetClass'=>\kartik\widgets\SwitchInput::classname()
//    ];
?>
<div class="row">
    <div class="col-sm-offset-2 col-sm-8">
        <?php
        echo TabularForm::widget([
            'dataProvider' => $contactDataProvider,
            'form' => $form_contact,
            'attributes' => $attribs,
            'gridSettings' => [
                'floatHeader' => true,
                'panel' => [
                    'heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-book"></i>联系人信息</h3>',
                    'type' => GridView::TYPE_PRIMARY,
                    'after' => Html::a('<i class="glyphicon glyphicon-plus"></i> Add New', '#', ['class' => 'btn btn-success']) . ' ' .
                        Html::a('<i class="glyphicon glyphicon-remove"></i> Delete', '#', ['class' => 'btn btn-danger']) . ' ' .
                        Html::submitButton('<i class="glyphicon glyphicon-floppy-disk"></i> Save', ['class' => 'btn btn-primary'])
                ]
            ]
        ]);
        ActiveForm::end();
        ?>
    </div>
</div>